<template>
  <div class="batchGenAudio-content">
    <el-form label-width="120px" class="padding10">
      <el-form-item label="待生成文件目录:">
        <el-input v-model="batchGenAudio.inPath" />
      </el-form-item>
      <el-form-item label="音频输出目录:">
        <el-input v-model="batchGenAudio.outPath" />
      </el-form-item>
    </el-form>
    <div class="oper">
      <el-button type="primary" @click="batchGen">生成</el-button>
    </div>
  </div>
</template>

<script>
import { batchTts } from '@/api/bvmodel/bvmodel';
export default {
  name: 'BatchGenAudio',
  data() {
    return {
      batchGenAudio: {
        inPath: '',
        outPath: ''
      },
    };
  },

  created() {
  },
  computed: {
    pageConfig() {
      return this.$store.state.page.config;
    }
  },
  methods: {
    /**
       * 批量生成
       */
    batchGen() {
      if (!this.batchGenAudio.inPath) {
        this.$message.error("请输入待生成文件目录");
        return;
      }
      if (!this.batchGenAudio.outPath) {
        this.$message.error("请输入音频输出目录");
        return;
      }
      batchTts({
        inPath: this.batchGenAudio.inPath,
        outPath: this.batchGenAudio.outPath
      }).then((res) => {
        if (res.result) {
          this.$message.success("生成成功");
        }
      });
    },
  }
};
</script>

<style lang="scss" scoped></style>
